<%@ page import="com.auctionhaus.Listing" %>
<%@ page import="com.auctionhaus.Customer" %>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <meta name="layout" content="main" />
        <g:set var="entityName" value="${message(code: 'listing.label', default: 'Listing')}" />
        <title><g:message code="default.create.label" args="[entityName]" /></title>
    </head>
    <body>
        <div class="body">
            <h1><g:message code="default.create.label" args="[entityName]" /></h1>
            <g:if test="${flash.message}">
            <div class="message">${flash.message}</div>
            </g:if>
            <g:hasErrors bean="${listingInstance}">
            <div class="errors">
                <g:renderErrors bean="${listingInstance}" as="list" />
            </div>
            </g:hasErrors>
            <g:if test="${session?.customer}">
                    <g:form action="save" >
                    <div class="dialog">
                        <table>
                            <tbody>
                                <div class="formField" align="right">
                                  <label for="listName">List Name:</label>
                                  <g:textField name="listName" value="${listingInstance?.listName}" />
                                </div>
                                <div class="formField" align="right">
                                    <label for="description">Description:</label>
                                    <g:textField name="description" value="${listingInstance?.description}"/>
                                </div>
                                <div class="formField" align="right">
                                    <label for="startBidPrice">Starting Bid Price:</label>
                                    <g:textField name="startBidPrice" value="${listingInstance?.startBidPrice}"/>
                                </div>
                                <g:hiddenField name="seller.emailAddress" value="${session.customer?.emailAddress}" />
                                <span class="formField" align="right">
                                    <label for="endDateTime">End Date Time:</label>
                                    <g:datePicker name="endDateTime" value="${listingInstance?.endDateTime}"/>
                                </span>
                            </tbody>
                        </table>
                    </div>
                    <div class="buttons">
                        <span class="button"><g:submitButton name="create" class="save" value="${message(code: 'default.button.create.label', default: 'Create')}" /></span>
                    </div>
                </g:form>
            </g:if>
        </div>
    </body>
</html>
